package com.jzo2o.orders.manager.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jzo2o.api.trade.dto.response.NativePayResDTO;
import com.jzo2o.orders.base.model.domain.Orders;
import com.jzo2o.orders.manager.model.dto.request.OrdersPayReqDTO;
import com.jzo2o.orders.manager.model.dto.request.PlaceOrderReqDTO;
import com.jzo2o.orders.manager.model.dto.response.OrdersPayResDTO;
import com.jzo2o.orders.manager.model.dto.response.PlaceOrderResDTO;

import java.time.LocalDateTime;

/**
 * <p>
 * 下单服务类
 * </p>
 *
 * @author itcast
 * @since 2023-07-10
 */
public interface IOrdersCreateService extends IService<Orders> {


    PlaceOrderResDTO placeOrder(PlaceOrderReqDTO placeOrderReqDTO);

    Long generateOrderId();

    void add(Orders orders);
    /**
     * 使用优惠券下单
     * @param orders 订单信息
     * @param couponId 优惠券id
     */
    public void addWithCoupon(Orders orders, Long couponId);

    OrdersPayResDTO pay(Long id, OrdersPayReqDTO ordersPayReqDTO);

    void updateOrders(Long id, NativePayResDTO resDTO);

    OrdersPayResDTO payResult(Long id);

    void paySuccess(Long id, String transactionId, LocalDateTime paySuccessTime);
}
